Page({

    /**
     * 页面的初始数据
     */
    data: {
        wheat: [
            {
                "id": 2,
                "name": "12db66f6",
                "display_name": "checkbox",
                "type": "checkbox"
            },
            // {
            //     "id": 3,
            //     "name": "上传图片",
            //     "display_name": "uploadImg",
            //     "type": "uploadImg"
            // },
            {
                "id": 10,
                "name": "97a247f4",
                "display_name": "textarea",
                "type": "textarea"
            },
            {
                "id": 15,
                "name": "f7e78e8a",
                "display_name": "file",
                "type": "file"
            },
            {
                "id": 16,
                "name": "645b47d8",
                "display_name": "text",
                "type": "text"
            },
            {
                "id": 27,
                "name": "ea4cf307",
                "display_name": "radio",
                "type": "radio"
            },
            {
                "id": 29,
                "name": "ba131a6b",
                "display_name": "textarea1",
                "type": "textarea"
            },
            {
                "id": 28,
                "name": "calendar",
                "display_name": "calendar",
                "type": "calendar"
            },
            {
                "id": 30,
                "name": "select",
                "display_name": "select",
                "type": "select"
            }
        ],

        list: []
    },

    getList: function() {
        const _this = this;
    },

    gotoDetail: function(e) {
        let _detail = e.currentTarget.dataset;
        wx.navigateTo({
            url: '../recordDetail/recordDetail',
            events: {
                acceptData_recordDetail: function (data) {
                    console.log(data)
                }
            },
            success: function(res) {
                console.log(res)
                res.eventChannel.emit('acceptData_recordList', _detail);
            }
        })
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
        const _this = this;
        this.getList();
        _this.setData({
            list: _this.data.wheat
        });

    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function() {
        console.log('onShow', this.data.list);
    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function() {
        console.log('onUnload', this.data.list);
    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function() {

    }
})